home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Message Dialogs / daily-info-feeder.izs < prev    next >
Text File  |  2005-09-28  |  5KB  |  199 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Daily information feeder
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>This is a sophisticated JavaScript that displays daily bits of information to your visitors.
  7. <!/DESCRIPTION> 
  8.  
  9. <!CATEGORY>messages<!/CATEGORY>
  10.  
  11. <!SCRIPT>
  12. <!-- START OF SCRIPT -->
  13. <form name="dailyinfo"><table border="0" cellspacing="3" cellpadding="0">
  14.     <tr>
  15.       <td width="100%"><strong>Daily site news</strong><br>
  16.       <textarea rows="5" name="dailycontent" cols="40" wrap="virtual"></textarea></td>
  17.     </tr>
  18.     <tr>
  19.       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  20.         <tr>
  21.           <td width="50%"><a href="javascript:moreinfo()">More Information</a></td>
  22.           <td width="50%"><div align="right"><p><input type="text" name="cdate" size="9"></td>
  23.         </tr>
  24.       </table>
  25.       </td>
  26.     </tr>
  27. <tr>
  28. <td>
  29. </td>
  30. </tr>
  31.   </table>
  32. </form>
  33.  
  34.  
  35. <script>
  36. <!--
  37.  
  38. var dailyinfo=new Array()
  39. var dailyinfolink=new Array()
  40.  
  41. //define the messages below, where the first one is for the 1st of this month, second is for the 2nd of this month, and so on. You do NOT have to define all of them at once. For example, you can just define enough to cover up to a week.
  42.  
  43. dailyinfo[1]=''
  44. dailyinfo[2]=''
  45. dailyinfo[3]=''
  46. dailyinfo[4]=''
  47. dailyinfo[5]=''
  48. dailyinfo[6]=''
  49. dailyinfo[7]=''
  50. dailyinfo[8]=''
  51. dailyinfo[9]=''
  52. dailyinfo[10]=''
  53. dailyinfo[11]=''
  54. dailyinfo[12]=''
  55. dailyinfo[13]=''
  56. dailyinfo[14]=''
  57. dailyinfo[15]=''
  58. dailyinfo[16]=''
  59. dailyinfo[17]=''
  60. dailyinfo[18]=''
  61. dailyinfo[19]=''
  62. dailyinfo[20]=''
  63. dailyinfo[21]=''
  64. dailyinfo[22]=''
  65. dailyinfo[23]=''
  66. dailyinfo[24]=''
  67. dailyinfo[25]=''
  68. dailyinfo[26]=''
  69. dailyinfo[27]=''
  70. dailyinfo[28]='Message for the 28th of this month goes here'
  71. dailyinfo[29]='Message for the 29th of this month goes here'
  72. dailyinfo[30]='Message for the 30th of this month goes here'
  73. dailyinfo[31]=''
  74.  
  75. //if any one of the daily messages above should click through to a URL, specify them here:
  76. dailyinfolink[28]="http://dynamicdrive.com"
  77. dailyinfolink[29]="http://news.com"
  78.  
  79. var mydate=new Date()
  80. var year=mydate.getYear()
  81. if (year < 1000)
  82. year+=1900
  83. var day=mydate.getDay()
  84. var month=mydate.getMonth()+1
  85. if (month<10)
  86. month="0"+month
  87. var daym=mydate.getDate()
  88.  
  89. document.dailyinfo.cdate.value=month+"/"+daym+"/"+year
  90. document.dailyinfo.dailycontent.value=dailyinfo[daym]
  91.  
  92. function moreinfo(){
  93. if (dailyinfolink[daym])
  94. window.location=dailyinfolink[daym]
  95. else
  96. alert("No additional information available for this news piece")
  97. }
  98.  
  99. //-->
  100. </script>
  101. <!-- END OF SCRIPT -->
  102. <!/SCRIPT>
  103.  
  104. <!PREVIEW>
  105. <!-- START OF SCRIPT -->
  106. <form name="dailyinfo"><table border="0" cellspacing="3" cellpadding="0">
  107.     <tr>
  108.       <td width="100%"><strong>Daily site news</strong><br>
  109.       <textarea rows="5" name="dailycontent" cols="40" wrap="virtual"></textarea></td>
  110.     </tr>
  111.     <tr>
  112.       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  113.         <tr>
  114.           <td width="50%"><a href="javascript:moreinfo()">More Information</a></td>
  115.           <td width="50%"><div align="right"><p><input type="text" name="cdate" size="9"></td>
  116.         </tr>
  117.       </table>
  118.       </td>
  119.     </tr>
  120. <tr>
  121. <td>
  122. </td>
  123. </tr>
  124.   </table>
  125. </form>
  126.  
  127.  
  128. <script>
  129. <!--
  130.  
  131. var dailyinfo=new Array()
  132. var dailyinfolink=new Array()
  133.  
  134. //define the messages below, where the first one is for the 1st of this month, second is for the 2nd of this month, and so on. You do NOT have to define all of them at once. For example, you can just define enough to cover up to a week.
  135.  
  136. dailyinfo[1]=''
  137. dailyinfo[2]=''
  138. dailyinfo[3]=''
  139. dailyinfo[4]=''
  140. dailyinfo[5]=''
  141. dailyinfo[6]=''
  142. dailyinfo[7]=''
  143. dailyinfo[8]=''
  144. dailyinfo[9]=''
  145. dailyinfo[10]=''
  146. dailyinfo[11]=''
  147. dailyinfo[12]=''
  148. dailyinfo[13]=''
  149. dailyinfo[14]=''
  150. dailyinfo[15]=''
  151. dailyinfo[16]=''
  152. dailyinfo[17]=''
  153. dailyinfo[18]=''
  154. dailyinfo[19]=''
  155. dailyinfo[20]=''
  156. dailyinfo[21]=''
  157. dailyinfo[22]=''
  158. dailyinfo[23]=''
  159. dailyinfo[24]=''
  160. dailyinfo[25]=''
  161. dailyinfo[26]=''
  162. dailyinfo[27]=''
  163. dailyinfo[28]='Message for the 28th of this month goes here'
  164. dailyinfo[29]='Message for the 29th of this month goes here'
  165. dailyinfo[30]='Message for the 30th of this month goes here'
  166. dailyinfo[31]=''
  167.  
  168. //if any one of the daily messages above should click through to a URL, specify them here:
  169. dailyinfolink[28]="http://dynamicdrive.com"
  170. dailyinfolink[29]="http://news.com"
  171.  
  172. var mydate=new Date()
  173. var year=mydate.getYear()
  174. if (year < 1000)
  175. year+=1900
  176. var day=mydate.getDay()
  177. var month=mydate.getMonth()+1
  178. if (month<10)
  179. month="0"+month
  180. var daym=mydate.getDate()
  181.  
  182. document.dailyinfo.cdate.value=month+"/"+daym+"/"+year
  183. document.dailyinfo.dailycontent.value=dailyinfo[daym]
  184.  
  185. function moreinfo(){
  186. if (dailyinfolink[daym])
  187. window.location=dailyinfolink[daym]
  188. else
  189. alert("No additional information available for this news piece")
  190. }
  191.  
  192. //-->
  193. </script>
  194.  
  195. <!-- END OF SCRIPT -->
  196. <!/PREVIEW>
  197.  
  198. <!RELATED>NONE<!/RELATED>
  199.